/**
 * NewX3D
 * 
 * AUTHOR:	Ma Chao
 * EMAIL:	machaoii@263.net
 * MSN:	    machaoii@hotmail.com
 * QQ:	    68552233
 * _____________________________________________________________
 * http://newx3d.cn/blog   http://code.google.com/p/newx3d/
 * 
 * Copyright 2008 Ma Chao

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

package kgame5.k3d.core.render.layerrender.impl.zbuffer {

class ZBuffer
	{
		public var width:int;
		public var height:int;
		public var sizeq:int;
		public var data:Array;
		public function ZBuffer(width:int,height:int)
		{
			// this function creates a zbuffer with the sent width, height, 
			// and bytes per word, in fact the the zbuffer is totally linear
			// but this function is nice so we can create it with some
			// intelligence
			
			// is this a valid object
			
			
			// is there any memory already allocated
			
			
			// set fields
			this.width  = width;
			this.height = height;
			this.sizeq=width*height;
			clear();
			
		}
		public function del():void{
			this.data=null;
		}
		public function clear():void{
			this.data=new Array(this.height);
			for(var i:int=0;i<this.height;i++){
				this.data[i]=new Array(this.width);
				
			}
			//this.data=Util.NewArray2_Number(this.height, this.width, Number.MAX_VALUE-1);
	}
}
}